package tempEngine.network.distantSide;

import java.awt.Point;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

import tempEngine.network.SocketThread;

public abstract class DistantSocketThread extends SocketThread {

	public DistantSocketThread(Socket s) throws UnknownHostException,
			IOException {
		super(s);
	}

	@Override
	protected abstract void preRunLoopHandling() throws IOException;
	/* *
	 * NOTE : we keep this one abstract because it should content the 
	 *  identification part to tell the server if we are in a 
	 *  spectator or player mode
	 * */
	
	@Override
	protected void runLoopHandling() {
		// TODO read 2 points and then them using a specific 
		//notification system: 
		
	}
	
	/**
	 * Method called when the runLoop successfully receive new 
	 * coordinates 
	 * @param fstPoint first player new coordinate
	 * @param sndPoint second player new coordinate
	 * NOTE : by default, we set the first in the left part of the 
	 * screen and it's associate to the host player (and recpectively 
	 * second, right, distant player) 
	 */
	protected abstract void notifyNewCoords(Point fstPoint, Point sndPoint);
	
	@Override
	protected void postRunLoopHandling() {
		// nothing to do for now ...
	}
}
